﻿using ERPSystem.Common.BaseEntitys;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ERPSystem.Common.Domains.supplier
{
    /// <summary>
    /// 采购订单表
    /// </summary>
    [SugarTable("PurchaseOrder")]
    public class PurchaseOrder : BaseEntity
    {
        /// <summary>
        /// 采购订单主键
        /// </summary>
        [SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
        public int PurchaseOrderId { get; set; }
        /// <summary>
        /// 单据编码
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string ReceiptNum { get; set; }
        /// <summary>
        /// 单据状态
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string ReceiptState { get; set; }
        /// <summary>
        /// 单据日期
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime ReceiptDate { get; set; }
        /// <summary>
        /// 业务类型
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string BusinessType { get; set; }
        /// <summary>
        /// 业务状态
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string ServiceStatus { get; set; }
        /// <summary>
        /// 采购部门
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string Department{ get; set; }
        /// <summary>
        /// 采购人员
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string Buyer { get; set; }
        /// <summary>
        /// 操作人
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string Operator { get; set; }
        /// <summary>
        /// 审核员
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string Auditor { get; set; }
        /// <summary>
        /// 审核日期
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime ApprovalDate { get; set; }
        /// <summary>
        /// 用料需求
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string MaterialDemand { get; set; }
        /// <summary>
        /// 供方
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string System { get; set; }
        /// <summary>
        /// 到货日期
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime DeliveryDate { get; set; }
        /// <summary>
        /// 采购合同
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string PurchasingContract { get; set; }
        /// <summary>
        /// 备注信息
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string Remark { get; set; }
        /// <summary>
        /// 跟单编号
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string OrderNumber { get; set; }
        /// <summary>
        /// 物料编码
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string MaterialCode { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string MaterialName { get; set; }
        /// <summary>
        /// 型号规格
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string TypeSpecification { get; set; }
        /// <summary>
        /// 颜色
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(50)", IsNullable = true)]
        public string Color { get; set; }
        /// <summary>
        /// 主计量
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string DocumentType { get; set; }
        /// <summary>
        /// 需求日期
        /// </summary>    
        [SugarColumn(IsNullable = true)]
        public DateTime RequirementDate { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public int Quantity { get; set; }
        /// <summary>
        /// 单价
        /// </summary>
        public decimal UnitPrice { get; set; }
        /// <summary>
        /// 金额
        /// </summary>
        public decimal Amount { get; set; }
        /// <summary>
        /// 到货数量
        /// </summary>
        public int ArrivalQuantity { get; set; }
        /// <summary>
        /// 采购说明
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)", IsNullable = true)]
        public string PurchaseDescription { get; set; }

    }
}
